﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EnvDTE80;
using c0x3y.StyleCopFixer.Interfaces;

namespace c0x3y.StyleCopFixer.Objects
{
    public class StyleCopError
    {
        private string errorCode;
        private EnvDTE.DTE dte;
        private IFixable errorFixer;

        public StyleCopError(EnvDTE.DTE dte, string errorCode)
        {
            this.errorCode = errorCode;
            this.dte = dte;
        }

        public ErrorItem Error { get; set; }        

        public string ErrorCode
        {
            get
            {
                return this.errorCode;
            }
        }      

        public void FixError()
        {
            if (errorFixer != null)
            {
                errorFixer.Run(this.dte, this.Error);
            }
        }
    }
}
